Skip to content

fix(supernova): improve filter ComboBox UX with display limit and search state workarounds#1619

Merged
ArtieReus merged 8 commits intomainfrom
artie-fix-supernova-dropdown
Apr 24, 2026
Merged

fix(supernova): improve filter ComboBox UX with display limit and search state workarounds#1619
ArtieReus merged 8 commits intomainfrom
artie-fix-supernova-dropdown

Conversation

@ArtieReus
Copy link
Copy Markdown
Collaborator

@ArtieReus ArtieReus commented Apr 21, 2026

Summary

Improves the Supernova filter ComboBox UX by showing an informational message when more than 100 filter values are available, and implements a workaround to clear the ComboBox's internal search state after selecting a filter value.

Changes Made

  • Added displayLimit state (100 items) and comboBoxKey state for forcing ComboBox remount
  • Extracted filter rendering logic into renderFilterOptions() function
  • When >100 filtered values exist, displays an informational disabled ComboBoxOption at the bottom:
    • Without search: "Showing 100 of 450. Search to filter."
    • With search: "prod" - Showing 100 of 150. Refine search for more."
  • The message includes the search query in its label to survive ComboBox's internal filtering
  • Added workaround to clear ComboBox's internal search state after item selection using key increment
  • Reset display limit when changing filter label or search query

Related Issues

Problem Statement

Original Issue

An attempt was made to implement progressive loading with a "Load more" button to handle filter labels with >100 values. However, this approach had a fundamental architectural flaw:

The Core Problem: ComboBox internally filters its children (including ComboBoxOption elements) based on the user's input query. When a user types a search query (e.g., "production"), the "Load … more items" button gets filtered out because its text doesn't match the query. This breaks progressive loading exactly when it's most needed - during filtered searches.

The ComboBox component's filtering logic (lines 340-352 in ComboBox.component.tsx):

const filteredChildren = Children.toArray(children).filter((child) => {
  if (isValidElement<ComboBoxOptionProps>(child)) {
    const optionDisplayValue = child.props.children?.toString() || child.props.label || child.props.value
    return optionDisplayValue?.toLowerCase().includes(query.toLowerCase())
  } else {
    return false  // Non-ComboBoxOption elements get filtered out
  }
})

Any element (including action buttons) that doesn't match the query gets filtered out.

Why Progressive Loading Couldn't Be Kept

Multiple approaches were attempted to make progressive loading work:

  1. Using <a> tag for "Load more" - Gets filtered out (not a ComboBoxOption)
  2. Using disabled ComboBoxOption - Can't be clicked (disabled blocks pointer events)
  3. Using enabled ComboBoxOption - Gets selected as a value instead of loading more
  4. Wrapping in div with onClick - Div wrapper gets filtered out (not a ComboBoxOption)
  5. Including query in button text - Makes "Load more" survive filtering but creates unusable UX with interactive elements

The fundamental constraint: The Juno ComboBox component (from the design system) cannot be modified, and it doesn't support non-filterable items or footer content.

Chosen Solution

Instead of progressive loading, we display an informational message that:

  • ✅ Survives filtering (includes query in label text)
  • ✅ Cannot be selected (disabled)
  • ✅ Guides users to use search (actionable guidance)
  • ✅ Is clear and non-interactive (no confusing UX)

Additional workaround implemented: Force remount ComboBox using key increment to clear internal search state after selection. Without this, the search query persists and filters the dropdown when reopened.

Screenshots (if applicable)

Display Limit with NO search string
Screenshot 2026-04-22 at 23 21 08

Display Limit with search string
Screenshot 2026-04-22 at 23 21 25

Added workaround to clear ComboBox's internal search state after item selection using key increment

Screen.Recording.2026-04-22.at.23.22.58.mov

Testing Instructions

  1. pnpm i
  2. pnpm dev:supernova
  3. Navigate to the alerts page
  4. Select a filter label that has more than 100 possible values (e.g., labels with many regions/zones)
  5. Verify informational message: Confirm you see "Showing 100 of X. Search to filter." at the bottom
  6. Test filtering: Type a search query (e.g., "prod")
  7. Verify message updates: Confirm the message shows "prod" - Showing 100 of X. Refine search for more."
  8. Test selection and clearing: Select an item from the filtered results
  9. Reopen dropdown: Click on the ComboBox again
  10. Verify search cleared: Confirm the search input is empty and all options are visible (not filtered by previous search)

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

Additional Context

Future Enhancement: A feature request has been issued: #1627
These enhancements would eliminate the need for workarounds and enable proper progressive loading in the future.

@ArtieReus ArtieReus requested a review from a team as a code owner April 21, 2026 13:07
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 21, 2026

🦋 Changeset detected

Latest commit: 9b0b4b8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cloudoperators/juno-app-supernova Patch
@cloudoperators/juno-app-greenhouse Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an alerts filter UX issue in Supernova where the filter value ComboBox effectively capped visible matches at 100 even after the user typed a query, by introducing progressive “load more” behavior in the dropdown.

Changes:

  • Added a displayLimit state (default 100) and reset logic when changing the filter label.
  • Reworked dropdown option rendering to slice by displayLimit after applying filtering.
  • Added a “Load 100 more items…” control at the bottom of the dropdown when more matches are available.
  • Added a patch changeset for @cloudoperators/juno-app-supernova.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
apps/supernova/src/components/filters/FilterSelect.tsx Adds progressive loading state and renders a “load more” control for filtered ComboBox options.
.changeset/ready-candles-kiss.md Records a patch release note for the Supernova fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/supernova/src/components/filters/FilterSelect.tsx Outdated
Comment thread apps/supernova/src/components/filters/FilterSelect.tsx Outdated
Comment thread apps/supernova/src/components/filters/FilterSelect.tsx Outdated
Comment thread apps/supernova/src/components/filters/FilterSelect.tsx Outdated
@ArtieReus ArtieReus marked this pull request as draft April 21, 2026 14:01
@ArtieReus ArtieReus requested a review from Copilot April 22, 2026 21:25
@ArtieReus ArtieReus changed the title fix(supernova): Add progressive loading to filter dropdown fix(supernova): add progressive loading to filter dropdown Apr 22, 2026
@ArtieReus ArtieReus marked this pull request as ready for review April 22, 2026 21:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/supernova/src/components/filters/FilterSelect.tsx
Comment thread .changeset/ready-candles-kiss.md Outdated
Comment thread apps/supernova/src/components/filters/FilterSelect.tsx
Comment thread apps/supernova/src/components/filters/FilterSelect.tsx
ArtieReus and others added 2 commits April 22, 2026 23:30
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread apps/supernova/src/components/filters/FilterSelect.test.tsx Fixed
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@ArtieReus ArtieReus changed the title fix(supernova): add progressive loading to filter dropdown fix(supernova): improve filter ComboBox UX with display limit and search state workarounds Apr 23, 2026
@ArtieReus ArtieReus self-assigned this Apr 23, 2026
@taymoor89 taymoor89 added the greenhouse-pr-preview Builds a PR preview for greenhouse shell app and plugins. label Apr 23, 2026
@franzheidl
Copy link
Copy Markdown
Member

The proposed solution lgtm in terms of UX/UI for now.

We may want to investigate whether we want to support Headless UI's ComboCox virtual scrolling feature as an option in the future to circumvent the problem altogether.

@ArtieReus ArtieReus merged commit e69fd99 into main Apr 24, 2026
17 checks passed
@ArtieReus ArtieReus deleted the artie-fix-supernova-dropdown branch April 24, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

greenhouse-pr-preview Builds a PR preview for greenhouse shell app and plugins.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug](supernova): filter selection not resetting correctly

5 participants